package io;

import java.io.FileOutputStream;

/**
 * @author Luka
 * @date 2021/05/28 11:14
 *
 * 给文件写入字符串
 **/
public class WriteStringDemo {
    public static void main(String[] args) throws Exception {
        FileOutputStream fos = new FileOutputStream("demo.dat");
        String str ="super idol的笑容都没你的甜";

        /*
         */
        byte[] data = str.getBytes("UTF-8");
        fos.write(data);

        fos.write("八月正午的阳光,都没你耀眼".getBytes("UTF-8"));

        System.out.println("写出完毕!");
        fos.close();
    }
}